Skip to content

Conversation

@gin7773
Copy link
Contributor

@gin7773 gin7773 commented Dec 24, 2025

Main changes:

  • Support parsing SMPE-TT subtitle attributes for DASH.
  • Support displaying multi-line text subtitles for DASH.
  • Support image format subtitles for DASH.

@gin7773 gin7773 marked this pull request as draft December 24, 2025 02:32
@gin7773 gin7773 marked this pull request as ready for review January 7, 2026 02:40
@gin7773 gin7773 requested review from JSUYA and seungsoo47 January 7, 2026 02:40
@JSUYA
Copy link
Member

JSUYA commented Jan 7, 2026

@seungsoo47 Could you review this?

@seungsoo47
Copy link
Contributor

@seungsoo47 Could you review this?

OK

case SubtitleAttrType.subAttrWebvttCuePositionAlign:
case SubtitleAttrType.subAttrWebvttCueVertical:
case SubtitleAttrType.subAttrTimestamp:
case SubtitleAttrType.subAttrExtsubInde:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
case SubtitleAttrType.subAttrExtsubInde:
case SubtitleAttrType.subAttrExtsubIndex:

return const Color(0x00000000);
}
String hexValue = colorValue.toRadixString(16);
if (hexValue.length < 6) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How about changing 6 to a Constant?

}
actualTextStyle = actualTextStyle.copyWith(
color: actualTextStyle.color!
.withValues(alpha: attr.attrValue as double));
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think you need to check if the variable attr.attrValue is double.
And, the attrValue must have a value between 0.0 and 1.0.
Please ensure that the attrValue is within the correct range.

if (hexValue.length == 6) {
hexValue = 'FF$hexValue';
}
if (hexValue.length == 8) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How about changing 8 to a Constant?

switch (attr.attrType) {
// For text origin and extent.
case SubtitleAttrType.subAttrRegionXPos:
final double xPos = attr.attrValue as double;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think you need to check if the variable attr.attrValue is double.
Please also check other items below.

size, picture_width, picture_height);

int subtitle_mem_length = 0;
int channels = size / (picture_width * picture_height);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The picture_width and picture_height variables must not be 0.
How about adding the check code?

if (picture_width <= 0 || picture_height <= 0 || size <= 0) {
  LOG_ERROR("[PlusPlayer] Invalid picture dimensions or size: w=%f, h=%f, size=%d", 
            picture_width, picture_height, size);
  return;
}

And how about adding the overflow check code?

const double area = picture_width * picture_height;
if (area > static_cast<double>(std::numeric_limits<int>::max())) {
LOG_ERROR("[PlusPlayer] Picture area too large: %f", area);
  return;
}


PlusPlayer *self = reinterpret_cast<PlusPlayer *>(user_data);

int text_lines_count = 1;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please change 1 to a Constant.

float value_float;
std::memcpy(&value_float, &value_temp, sizeof(float));
LOG_INFO("[PlusPlayer] Subtitle update: value<float>: %f", value_float);
const float *value_float = static_cast<const float *>(attr->value);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please add type checking and null checking code.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants